[mirrors]
http://www.hping.org/hping2.0.0-rc3.tar.gz

[vars]
filesize=124573
sha512=a5273ddf98d39f8bd602d7653bb7e024c1d0a48e6619d0e15eac9ce877d4869fd7e5500f86cc2a35b29b95a27012f2e8c6f69d9bb11e6f9bd30edafd459a1a9c
tardir=hping2-rc3
[deps]

[build]
patch -p1 < "$K"/hping2-endian.patch
sed -i 's@./hping2 -v@true@g' Makefile.in

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

export CC="$CC -D_GNU_SOURCE $optcflags $optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags
endian=__LITTLE_ENDIAN_BITFIELD
[ $("$K"/endiancheck.sh) = "big" ] &&  endian=__BIG_ENDIAN_BITFIELD
printf "#define %s\n" "$endian" > byteorder.h

#[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make V=1 -j$MAKE_THREADS CC="$CC"
install -D -m 755 hping2 "$butch_install_dir""$butch_prefix"/sbin/hping2
install -D -m 644 docs/hping2.8 "$butch_install_dir""$butch_prefix"/share/man/man8/hping2.8

